package blt.app_core.http.request;

import blt.app_core.utils.CacheUtil;
import blt.app_core.utils.UriProdiver;
import okhttp3.FormBody;
import okhttp3.Request;
import okhttp3.RequestBody;

/**
 * Created by xgp on 2017/6/21.
 */

public class LoginRequest {


    public static Request getLoginRequest() {
        String cookie = CacheUtil.getCache().getCookie();
        String userId = CacheUtil.getCache().getUid();
        Request.Builder builder = new Request.Builder();
        builder.addHeader("userCookieName", cookie);
        FormBody.Builder formBody = new FormBody.Builder();
        formBody.add("userId", userId);
        RequestBody body = formBody.build();
        builder.url(UriProdiver.BASE_URL).post(body).build();
        Request request = builder.build();
        return request;
    }

}
